package practicedemo64.Javabean;

public class Employ {
    //标准Javabean
    /*
    *
    * 1.类名见名知意
    * 2.所有的成员变量都需要私有
    * 3.构造方法（空参构造，带全部参数的）
    * 4.get/set方法
    *
    * */

    private String id;
    private String name;
    private double salary;

    public void eat() {
        System.out.println("吃米饭");
    }

    public void work() {
        System.out.println("员工在工作");
    }

    public Employ() {
    }

    public Employ(String id, String name, double salary) {
        this.id = id;
        this.name = name;
        this.salary = salary;
    }

    /**
     * 获取
     *
     * @return id
     */
    public String getId() {
        return id;
    }

    /**
     * 设置
     *
     * @param id
     */
    public void setId(String id) {
        this.id = id;
    }

    /**
     * 获取
     *
     * @return name
     */
    public String getName() {
        return name;
    }

    /**
     * 设置
     *
     * @param name
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * 获取
     *
     * @return salary
     */
    public double getSalary() {
        return salary;
    }

    /**
     * 设置
     *
     * @param salary
     */
    public void setSalary(double salary) {
        this.salary = salary;
    }

    public String toString() {
        return "Employ{id = " + id + ", name = " + name + ", salary = " + salary + "}";
    }
}
